<template>
  <div class="demo">
    <h1>shopCart</h1>

    <van-swipe v-loading="list" class="my-swipe" :autoplay="3000" indicator-color="white">
      <van-swipe-item v-for="item in list" :key="item.id">
        {{item.img}}
      </van-swipe-item>
    </van-swipe>
  </div>
</template>

<script>
import { computed, onMounted, reactive, toRefs } from "vue";
import { getBanners } from "api/request";
export default {
  name: "demo",
  setup(props) {
    const state = reactive({
      list:[]
    });
    onMounted(async () => {
      let data = await getBanners();
      state.list=data.data.data
    });
    return {
      ...toRefs(state),
    };
  },
};
</script>

<style lang='scss' scoped>
.my-swipe .van-swipe-item {
  color: #fff;
  font-size: 20px;
  line-height: 150px;
  text-align: center;
  background-color: #39a9ed;
}
</style>
